package com.xkcyy.study.jvm.bytecode.gen;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Optional;

/**
 * StringTuple
 *
 * @author yuand
 * @date 2021/8/23
 **/
public class NumberTuple<T extends Number> extends Tuple<T> {

    @Override
    public void set(T item) {
        super.set(item);
    }

    public void set2(Object item2) {
        super.set((T) item2);
    }
    public void set3(T item){
        super.set(item);
    }

    public static void main(String[] args) throws NoSuchMethodException {
        Method set31 = NumberTuple.class.getDeclaredMethod("set3", Number.class);


        Optional<Method> set3 = Arrays.stream(NumberTuple.class.getDeclaredMethods()).filter(x -> x.getName().equals("set3")).findAny();
        Method method = set3.get();
        Class<?> type = method.getParameters()[0].getType();
    }
}
